# Makefile for compiling a TObject derived ROOT class
#
# Derek Feichtinger <derek.feichtinger@cern.ch>
# (q.v. example Makefile in ROOT's test directory)

########################################################
#Make sure that your Environment variable LD_LIBRARY_PATH
#has been correctly set.

# provide the name of your class in the TARGET variable
TARGET = dataselector 

########################################################
# The rest of the makefile does not need to be modified

ROOTLIBS      = -L$(ROOTSYS)/lib -lNew -lBase -lCint -lClib -lCont -lFunc \
                -lGraf -lGraf3d -lHist -lHtml -lMatrix -lMeta -lMinuit -lNet \
                -lPostscript -lProof -lTree -lUnix -lZip
ROOTGLIBS     = -lGpad -lGui -lGX11 -lX3d

TARGETSRC=$(TARGET).C
TARGETCINT=$(TARGET)Cint.cxx
TARGETCINTO=$(TARGET)Cint.o
TARGETO = $(TARGET).o
TARGETSO = $(TARGET)_C.so

# Linux/gcc-2.96 version
CXX           = g++
CXXFLAGS      = -O -Wall -fPIC -I$(ROOTSYS)/include
LD            = g++
LDFLAGS       = -g
SOFLAGS       = -Wl,-soname,$(TARGETSO) -shared
LIBS          = $(ROOTLIBS) -lg++ -lm -ldl -rdynamic
GLIBS         = $(ROOTLIBS) $(ROOTGLIBS) -L/usr/X11R6/lib \
                -lXpm -lX11 -lg++ -lm -ldl -rdynamic

all: $(TARGETSO)

$(TARGETCINT):
	rootcint -f $(TARGETCINT) -c -I$(ROOTSYS)/include $(TARGET).h

$(TARGETCINTO): $(TARGETCINT)
	$(CXX) $(CXXFLAGS) -c -o $(TARGETCINTO) $(TARGETCINT)

$(TARGETSO): $(TARGETO) $(TARGETCINTO)
	$(LD) $(SOFLAGS) $(LDFLAGS) $(TARGETO) $(TARGETCINTO) -o $(TARGETSO)

clean:
	rm -f $(TARGETO) $(TARGETCINTO) $(TARGETCINT) $(TARGET)Cint.h $(TARGETSO)

